import requests
import json
def token(username='developer', password='developer'):
    url = 'http://flash-admin.enilu.cn/prod-api/account/login'
    headers = {'Content-Type': 'application/x-www-form-urlencoded'}
    userdata = {'username': username, 'password': password}

    with requests.post(url=url,
                       headers=headers,
                       data=userdata) as response:
        d = json.loads(response.text)
        return d.get('data').get('token')
